-- GENERATED SPELL FOR [Mekthorg the Wild] --


function spell0_18677(pUnit, Event) --@Enrage,Self--
pUnit:FullCastSpellOnTarget(8599,pUnit)
pUnit:RegisterEvent('Sorts_18677', 550, 1)
end

function spell1_18677(pUnit, Event) --@Pike Vault,n/a--
pUnit:FullCastSpellOnTarget(38875,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18677', 621, 1)
end

function spell2_18677(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(15576,pUnit)
pUnit:RegisterEvent('Sorts_18677', 655, 1)
end

function spell3_18677(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(37704,pUnit)
pUnit:RegisterEvent('Sorts_18677', 2000, 1)
end

function Sorts_18677(pUnit, Event)
local choix_sorts_18677 = math.random(0, 3)
if choix_sorts_18677 == 0 then
pUnit:RegisterEvent('spell0_18677', 1, 1)
end
if choix_sorts_18677 == 1 then
pUnit:RegisterEvent('spell1_18677', 1, 1)
end
if choix_sorts_18677 == 2 then
pUnit:RegisterEvent('spell2_18677', 1, 1)
end
if choix_sorts_18677 == 3 then
pUnit:RegisterEvent('spell3_18677', 1, 1)
end
end

function mob18677_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18677', math.random(1500, 3000), 1)
end

function mob18677_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18677_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18677_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18677, 1, 'mob18677_Action')
RegisterUnitEvent(18677, 2, 'mob18677_Leave')
RegisterUnitEvent(18677, 3, 'mob18677_Kill')
RegisterUnitEvent(18677, 4, 'mob18677_Die')
